<?php
if (!defined("_INDEX")) { header("Location: /"); die; }

$user_id = UV::readInt(strip_tags($route->GET('user_id')));
$status = UV::readMQ(strip_tags($route->GET('status')));

$db->sendQuery("update `users` set `status` = '$status' where `user_id` = '$user_id' and `type` != 'administrator' limit 1");
if ($status == "banned"){
	$ban_time = time() + 604800; // +неделя
	$db->sendQuery("insert into `ban_users` values (NULL,'$user_id','$ban_time')");
} else {
	$db->sendQuery("delete from `ban_users` where `user_id` = '$user_id'");
}

goToPage($_SERVER['HTTP_REFERER']);

?>